const { src, dest, series } = require('gulp');
const del = require('del');
const rename = require('gulp-rename');

// 清除 chalk 下的文件
function clearChalk() {
    return del('chalk/**/*')
}

// 复制 element-theme-chalk 文件
function copyThemeChalk() {
    return src('node_modules/element-theme-chalk/src/**/*').pipe(dest('chalk'));
}

// 初始化变量文件
function initVar() {
    return src('chalk/common/var.scss')
        .pipe(rename({ prefix: 'init-' }))
        .pipe(dest('src/styles'));
}

exports.init = series(clearChalk, copyThemeChalk, initVar)